#ifndef _KERNEL_H_INCLUDED_
#define _KERNEL_H_INCLUDED_

#include "defines.h"
#include "syscall.h"

typedef struct _kz_context {
    uint32 sp;
} kz_context;

typedef struct _kz_thread {
    struct _kz_thread *next;
    char name[THREAD_NAME_SIZE + 1];
    int priority;
    char *stack;
    unsigned stacksize;
    uint16 flags;
#define THREAD_READY    (1 << 0)
#define THREAD_WAITMSG  (1 << 1)
    struct {
        kz_func_t func;
        int argc;
        char **argv;
    } init;
    struct {
        kz_syscall_type_t type;
        kz_syscall_param_t *param;
    } syscall;
    kz_context context;
} kz_thread;

int putready(kz_thread *p);
int sys_wakeup(kz_thread_id_t id);

#endif
